package com.sh.redis.suanfa;

import java.util.HashMap;
import java.util.Map;

public class Letou {

    public static void main(String[] args) {
        // 总共
        double t = 45;
        // 买的数量
        double b = 0;
        // 赔率
        double p = 47;
        double result = -50;
        Map<Double, Double> map = new HashMap<>();

        for(b = 1;b<=t;b++){
            // 中奖率
            double l = b/t;
            // 赚
            double z = p-b;
            // 亏
            double k = t;
            System.out.println(b+" : "+(z*l - t*(1-l)));
            result = Math.max(result, z*l - t*(1-l));
        }
        System.out.println(result);


        //le(t,b,p);
    }


    public static void le(Double t,Double b, Double p){
        // 中奖率
        double l = b/t;
        // 赚
        double z = p-b;
        // 亏
        double k = t;




    }
}
